package com.sto.stoapp.thread;

import android.content.Context;

import com.sto.stoapp.util.UnInstallUtil;

import sto.android.app.StoTongJNI;

/**
 * Created by wj on 2016-12-01.
 * 卸载旧应用
 */

public class UnInstallThread extends Thread{

    public final static String PACKAGE_KAILI="com.kaicom.stoapp.activity";
    public final static String PACKAGE_RONGXING="com.cneop.sto";
    public final static String PACKAGE_WANGFENG="com.cneop.stoExpress.cneops";

    private Context context;

    public UnInstallThread(Context context) {
        this.context = context;
    }

    @Override
    public void run() {
        super.run();
        String pdaBrand = StoTongJNI.getmPdaBrand();

        if (pdaBrand.equals("kaicom")) {
            //"凯立";
            UnInstallUtil.unInstallApp(context,PACKAGE_KAILI);
        } else if (pdaBrand.equals("urovo")) {
            //"优博讯";
        } else if (pdaBrand.equals("rongxin")) {
            //"荣信";
            UnInstallUtil.unInstallApp(context,PACKAGE_RONGXING);
        } else if (pdaBrand.equals("wangfeng")) {
            //"网风";
            UnInstallUtil.unInstallApp(context,PACKAGE_RONGXING);
        } else {
            //"凯立";
            UnInstallUtil.unInstallApp(context,PACKAGE_KAILI);
        }
    }
}
